﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CommandLib
{
    public class CookiesStore
    {
        public static void SetCookies(string key, string value, int expiresDate)
        {
            HttpCookie userCookie = new HttpCookie(key, value);
            userCookie.Expires.AddDays(expiresDate);
            HttpContext.Current.Response.Cookies.Add(userCookie);
        }

        public static string GetCookies(string key)
        {
            return HttpContext.Current.Request.Cookies[key] != null ? HttpContext.Current.Request.Cookies[key].Value : string.Empty;
        }
    }
}